﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;

namespace DSLFactory.VSCTDesigner
{
    partial class CommandHasParentBuilder
    {
        private static bool CanAcceptCommandAsTarget(Command command)
        {
            return command is Menu || command is Group || command is ExternCommand;
        }

        private static bool CanAcceptCommandAndCommandAsSourceAndTarget(Command sourceCommand, Command targetCommand)
        {
            if( sourceCommand is Menu )
                return targetCommand is Group || targetCommand is ExternCommand;
            if( sourceCommand is Group )
                return targetCommand is Menu || targetCommand is ExternCommand;

            return targetCommand is Group || targetCommand is ExternCommand;
        }
    }
}
